import Vue from 'vue'
import Router from 'vue-router'
const _import = require('./_import_' + process.env.NODE_ENV) 

const Layout = r => require.ensure([], () => r(require('@/pages/index/layout')), 'layout');

const Index = r => require.ensure([], () => r(require('@/pages/index/views/index')));//主页面

const Dialogue = r => require.ensure([], () => r(require('@/pages/index/views/dialogueManage')));

const _INDEX_PATH_PREFIX = "pages/index/views/dialogueManage";
const LeftSidePharse = r => require.ensure([], () => r(require(`@/${_INDEX_PATH_PREFIX}/leftSide/pharse.vue`)));
const LeftSideTrajectory = r => require.ensure([], () => r(require(`@/${_INDEX_PATH_PREFIX}/leftSide/trajectory.vue`)));
const LeftSideChatHistory = r => require.ensure([], () => r(require(`@/${_INDEX_PATH_PREFIX}/leftSide/chatHistory.vue`)));//chatHistory
const LeftSideCustomerInfo = r => require.ensure([], () => r(require(`@/${_INDEX_PATH_PREFIX}/leftSide/customerInfo.vue`)));//chatHistory

const _INTERCOOPERATE_PATH_PREFIX = "pages/index/views/interCooperate";
const InterCooperate = r => require.ensure([], () => r(require('@/pages/index/views/interCooperate')));
const InnerDialog = r => require.ensure([], () => r(require(`@/${_INTERCOOPERATE_PATH_PREFIX}/innerDialog.vue`)));
const WorkerManage = r => require.ensure([], () => r(require(`@/${_INTERCOOPERATE_PATH_PREFIX}/workerManage.vue`)));
const AutoAllot = r => require.ensure([], () => r(require(`@/${_INTERCOOPERATE_PATH_PREFIX}/autoAllot.vue`)));


const NoteMessage = r => require.ensure([], () => r(require('@/pages/index/views/noteMessage')));
const CustomerManage = r => require.ensure([], () => r(require('@/pages/index/views/customerManage')));
const AnalysisData = r => require.ensure([], () => r(require('@/pages/index/views/analysisData')));

const _CONFIG_PATH_PREFIX = "pages/index/views/configManage";
const Configuration = r => require.ensure([], () => r(require('@/pages/index/views/configManage')));
const websiteConfig = r => require.ensure([], () => r(require(`@/${_CONFIG_PATH_PREFIX}/websiteConfig`)));//网页代码
const chatWindow = r => require.ensure([], () => r(require(`@/${_CONFIG_PATH_PREFIX}/chatWindow`)));//对话窗口
const VnoteMessage = r => require.ensure([], () => r(require(`@/${_CONFIG_PATH_PREFIX}/noteMessage`)));//留言信息
const serverArea = r => require.ensure([], () => r(require(`@/${_CONFIG_PATH_PREFIX}/serverArea`)));//服务地区
const ipAddress = r => require.ensure([], () => r(require(`@/${_CONFIG_PATH_PREFIX}/ipAddress`)));//登录IP

const NotFound = r => require.ensure([], () => r(require('@/pages/index/views/notFound')));
const Login = r => require.ensure([], () => r(require('@/pages/index/views/login')));

const constantRouteMap = [{
    path: '/login',
    component: Login,
    name: 'Login'
},{
    path: '/404',
    component: NotFound,
    name: 'NotFound'
},{
    path: '',
    redirect: '/index'
},{
    path: '/index',
    name: 'Index',
    component: Index,
    children: [{
        path:'',
        redirect: '/index/dialogue/phrase'
    },{
        path: 'dialogue',
        name: 'Dialogue',
        component: Dialogue,
        children: [{
            path: '',
            redirect: '/index/dialogue/phrase'
        },{
            path: 'phrase',
            name: 'Phrase',
            component:LeftSidePharse
        },{
            path: 'trajectory',
            name: 'Trajectory',
            component:LeftSideTrajectory 
        },{
            path: 'chathistory',
            name: 'ChatHistory',
            component:LeftSideChatHistory 
        },{
            path: 'customerinfo',
            name: 'CustomerInfo',
            component:LeftSideCustomerInfo 
        }]
    },{
        path: 'intercooperate',
        name: 'InterCooperate',
        component: InterCooperate,
        children: [{
            path: '',
            redirect: '/index/intercooperate/innerdialog'
        },{
            path: 'innerdialog',
            name: 'InnerDialog',
            component: InnerDialog

        },{
            path: 'workermanage',
            name: 'WorkerManage',
            component: WorkerManage
        },{
            path: 'autoallot',
            name: 'AutoAllot',
            component: AutoAllot
        }]
    },{
        path: 'notemessage',
        name: 'noteMessage',
        component: NoteMessage
    },{
        path: 'customermanage',
        name: 'CustomerManage',
        component: CustomerManage
    },{
        path: 'analysisdata',
        name: 'AnalysisData',
        component: AnalysisData
    },{
        path: 'configuration',
        name: 'Configuration',
        component: Configuration,
        children: [{
            path: '',
            redirect: '/index/configuration/chatwindow'
        },{
            path: 'chatWindow',
            name: 'ChatWindow',
            component: chatWindow
        },{
            path: 'vnotemessage',
            name: 'VnoteMessage',
            component: VnoteMessage
        },{
            path: 'serverarea',
            name: 'ServerArea',
            component: serverArea
        },{
            path: 'ipaddress',
            name: 'IpAddress',
            component: ipAddress
        }]
    }]
}];

export default constantRouteMap
/**
 * meta : {
    roles: ['admin','editor']    页面权限控制
  }
 */

export const dynamicRouteMap = [{
    path: '/index',
    redirect: '/index',
    component: Index
}]




